home *** CD-ROM | disk | FTP | other *** search
- Path: news.trcinc.com!usenet
- From: Rich Paul <rpaul@trcinc.com>
- Newsgroups: comp.lang.c++
- Subject: Re: copy ctor for abstract classes?
- Date: Wed, 03 Apr 1996 10:21:34 -0500
- Organization: Technical Resource Connection
- Message-ID: <3162977E.5236@trcinc.com>
- References: <4jpcj1$229@doc.zippo.com>
- NNTP-Posting-Host: bajor-le1.trcinc.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB2 (WinNT; I)
-
- Clarence, Chiang wrote:
- >
- > In article <4jk8kg$e9h@darkstar.UCSC.EDU>, ray@cse.ucsc.edu says...
- > >
- > >Should an abstract base class have a copy constructor?
- > >
- > >Ray
- > >
- >
- > Well, I don't think so. Since an abstract base class is a class that define an
- > interface. It generally does not have any data member so usually there is no
- > need for an abstract base class to have a copy ctor.
-
- if it DOES have any data, though, it should have a
- copy constructor ... otherwise if these members are
- private, there will be no way to initialize them.
-
- The rule of thumb for copy constructors and
- assignment operators that I use is generally if
- there is a non-trivial destructor, there should be
- a copy constructor.
-
- Furthermore, if there is a copy constructor, there
- should be an assignment operator.
-